window: Prevent resize cursors from sticking
authorMatthias Clasen <mclasen@redhat.com>
Wed, 1 May 2019 00:16:21 +0000 (00:16 +0000)
committerMatthias Clasen <mclasen@redhat.com>
Wed, 1 May 2019 00:19:35 +0000 (20:19 -0400)
When a modal dialog is smaller than its parent,
we were keeping the resize cursor from the dialogs
edge all over the parent window, which looks
really irritating, since the resize cursors are
closely associated with the window edge. Fix
this by falling back to the default cursor
outside the grab widgets surface.

Closes: https://gitlab.gnome.org/GNOME/gtk/issues/23
gtk/gtkwindow.c

index 04c1decdfb7ad523cbe3e1ee472cae2845ad71a5..bdff204913c44792ca68e007deaf6fff2c5a3179 100644 (file)
@@ -9885,7 +9885,10 @@ update_cursor (GtkWindow *toplevel,
       /* Outside the grab widget, cursor stays to whatever the grab
        * widget says.
        */
-      cursor = gtk_widget_get_cursor (grab_widget);
+      if (gtk_widget_get_surface (grab_widget) == gtk_widget_get_surface (target))
+        cursor = gtk_widget_get_cursor (grab_widget);
+      else
+        cursor = NULL;
     }
   else
     {